package tests;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Random;

public class TestFileGeneration {


	public static void main(String[] args) {

		try
		{
		File file = new File("SampleData.txt");
        BufferedWriter output = new BufferedWriter(new FileWriter(file));
        output.write("4\n");
        output.append("2 4 2 4\n");
        Random generator=new Random();
        int i=0,j=0,val;
        String str;
        for(i=0;i<500;i++)
        {
        	val=generator.nextInt(10000);
        	str=""+val;
        	output.append(str+"\n");
        	for(j=0;j<100;j++)
        	{
        		val=generator.nextInt(10000);
        		if (generator.nextInt(100) > 50)
        		{
	         		val = -val; //For generating vector dimensions between -10,000 to 10,000
        		}
        		str=""+val;
            	output.append(str+" ");
        	}
        	output.append("\n");
        	val=generator.nextInt(10000);
        	str=""+val;
        	output.append(str+"\n");
        	for(j=0;j<100;j++)
        	{
        		val=generator.nextInt(10000);
        		if (generator.nextInt(100) > 50)
        		{
	         		val = -val; //For generating vector dimensions between -10,000 to 10,000
        		}
        		str=""+val;
            	output.append(str+" ");
        	}
        	output.append("\n");
        }    
        output.flush();
        output.close();	
        System.out.println("File generated successfully\n");
		}catch ( IOException e ) {
	           e.printStackTrace();
	        	}
	}

}
